import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { HealthCheckVO, HealthCheckForm, HealthCheckQuery } from '@/api/nursing/healthCheck/types';

/**
 * 查询健康监测列表
 * @param query
 * @returns {*}
 */

export const listHealthCheck = (query?: HealthCheckQuery): AxiosPromise<HealthCheckVO[]> => {
  return request({
    url: '/nursing/healthCheck/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询健康监测详细
 * @param id
 */
export const getHealthCheck = (id: string | number): AxiosPromise<HealthCheckVO> => {
  return request({
    url: '/nursing/healthCheck/' + id,
    method: 'get'
  });
};

/**
 * 新增健康监测
 * @param data
 */
export const addHealthCheck = (data: HealthCheckForm) => {
  return request({
    url: '/nursing/healthCheck',
    method: 'post',
    data: data
  });
};

/**
 * 修改健康监测
 * @param data
 */
export const updateHealthCheck = (data: HealthCheckForm) => {
  return request({
    url: '/nursing/healthCheck',
    method: 'put',
    data: data
  });
};

/**
 * 删除健康监测
 * @param id
 */
export const delHealthCheck = (id: string | number | Array<string | number>) => {
  return request({
    url: '/nursing/healthCheck/' + id,
    method: 'delete'
  });
};
